package main

import (
	"fmt"
	"runtime"
	"time"
)

func main() {

	//用go承载一个形参为空,返回值为空的函数
	go func() {
		defer fmt.Println("A.defer")
		func() {
			defer fmt.Println("B.defer")

			fmt.Println("B")
			runtime.Goexit()
		}()
		fmt.Println("A")
	}()

	for {
		time.Sleep(1 * time.Second)
	}
}
